package com.cnyz.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class StaticResourceConfig implements WebMvcConfigurer {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        // 配置静态资源路径
        registry.addResourceHandler("/uploads/static/**")
                .addResourceLocations("file:E:/uploads/");
    }

    //http://localhost:8080/uploads/static/pdf/04489f28-580f-41a0-8ceb-206f63fcf535.pdf
}
